#include<bits/stdc++.h>
using namespace std;

string s[100];

int main()
{
	string t;
	getline(cin, t);
	int cnt = 0, len = t.size();
	for(int i = 0;i < len;i++)
	{
		if(t[i] != ' ')
			cnt++;
		else if(!cnt)
			continue;
		else
		{
			cout<<cnt<<",";
			cnt = 0;
		}
	}
	cout<<cnt;
    return 0;
}

